<?php

class commentModel extends CI_Model {

	public function insert_com($data) {

		$this->db->insert("comments",$data);
		return $this->db->insert_id();
	}

	public function insert_adCom($data) {
		$this->db->insert("ad_comment",$data);
	}

	public function delete(){

	}

	public function getComments($note_id){

		$this->db->select('*');
		$this->db->from('ad_comment as adc');
        $this->db->join('comments as com','adc.comment_id = com.comment_id','INNER');
        $this->db->join('user as us','us.user_id = com.user_id','INNER');
        $this->db->where('ad_id',$note_id);
        return $this->db->get()->result();
	}



}